﻿Imports Logica
Imports System.Data.SqlClient
Imports Microsoft.Office.Interop

Partial Class DescargarCurriculo
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Gestor.usuarioTienePermiso(Session("identificacion"), 60) Then
            Response.Redirect("SinPermisos.aspx")
        End If

        If Request.QueryString("id") <> "" Then
            Try
                Dim doc As Word.Document

                doc = Gestor.usuarioObtenerCurriculo(Request.QueryString("id"))

                'Response.Clear()
                'Response.AddHeader("Content-Disposition", "attachment; filename=curriculo.doc")
                'Response.ContentType = "application/msword"
                doc.Save()
                'Response.End()
            Catch exc As SqlException
                Response.Write("Error de conexión.")
            Catch exc As Exception
                Response.Write(exc.Message)
            End Try
        Else
            Response.Write("No se ha seleccionado el usuario.")
        End If
    End Sub
End Class
